<?php

header('Content-Type: text/xml');
 echo '<?xml version="1.0" encoding="utf-8"?>
<adultes>';
 ?>

<?php 
 require_once("../test/php_connect.php");
$connexion = new PDO('mysql:host='.$PARAM_hote.';dbname='.$PARAM_nom_bd, $PARAM_utilisateur, $PARAM_mot_passe,array(PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES utf8"));
id=$_POST["id"];

$sql="SELECT * FROM adulte INNER JOIN identite ON identite.id_identite=usager.id_identite 
							INNER JOIN adresse ON adresse.id_adresse=etablissement.id_adresse
							INNER JOIN coordonnee ON adulte.id_coordonnee=coordonnee.id_coordonnee
							INNER JOIN ville ON adresse.id_ville= ville.id_ville WHERE id_usager=$id";
$query = $connexion->query($sql);
$tab_resul = array();
foreach($query as $row){
	echo '<adulte>';
	echo '<id_usager>'.$row['id_usager'].'</id_usager>';
	echo "<matricule >".$row['matricule']."</matricule>";
	echo "<date>".$row['date_creation']."</date>";
	echo '<qualite>'.$row['qualite']."</qualite>";
	echo "<classification type=\"select\">".$row['classification']."</classification>";
	echo "</usager>";
 }
echo "</usagers>";
?>